<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <title>主页</title>
</head>
<body>
<h3>当前用户：</h3>
<h3 id="name"></h3>
<!-- 全局js -->
<script th:src="@{/src/js/jquery.min.js}"></script>
<script th:src="@{/src/js/commons.js}"></script>
<script>
    $(function () {
        $.ajax({
            type: "POST",
            url: getContext() + '/user/getInfo',
            dataType: "json",
            data: {
                code: getParam("code")
            },
            success: function (data) {
                $("#name").text(data.username);
            }
        });
    })
</script>
</body>
</html>
